<% unless record.nil? or record.errors.empty? -%>
<div class="message error">
  <p>The <%= record.class.to_s.downcase %> could not be saved:</p>

  <ul>
    <% record.errors.full_messages.each do |m| %>
    <li><%= m.gsub(/ id /, ' ') %></li>
    <% end %>
  </ul>
</div>
<% end %>